<template>
    <v-container class="mt-4">

        <v-row class="grey lighten-3 pa-2" dense>
            <v-col :cols="12">
                <span class="font-weight-bold">名称:</span>
                <span class="ml-2"> {{org.name}}</span>
            </v-col>
             <v-col :cols="12">
                <span class="font-weight-bold">组织码:</span>
                <span class="ml-2"> {{org.org_code}}</span>
            </v-col>
            <v-col :cols="12">
                <span class="font-weight-bold">地址:</span>
                <span class="ml-2"> {{org.addr}}</span>
            </v-col>
        </v-row>

        <v-tabs class="mt-2">
            <v-tab :to="`/org/${this.id}`" replace>管理员</v-tab>
        </v-tabs>

        <router-view></router-view>
    </v-container>
</template>

<script>
    import axios from "axios";

    export default {
    data: () => ({
        dialog: false,
        org: {},
        id: 0,
    }),


    watch: {
        id(v) {
            this.load();
        }
    },

    created() {
        this.id = this.$route.params.id;
        
    },

    beforeRouteUpdate(to, from, next) {
        this.id = to.params.id;
        next();
    },
    
  
    methods: {
            load() {
                axios.get(`/org/${this.id}`).then((response) => {
                    this.org = response.data.data;
                })
                .catch(function () {})
                .then(function () {});
            },
        }
    };
</script>
